<div appBsModal #modal="bs-modal" class="modal fade" [ngClass]="modalExpandOb.className" tabindex="-1" role="dialog"
    aria-labelledby="modal" aria-hidden="true" [config]="{backdrop: 'static'}">
    <div class="modal-dialog modal-xl">
        <div class="modal-content">
            <div class="modal-header" style="padding:0.5rem">
                <h5 class="modal-title">
                    <span>{{title}}</span>
                </h5>

                <span class="pull-right" style="display:inline-block">

                    <button (click)="copyViews()" *ngIf="'Pages.Administration.FrontendPageView.Create' | permission"
                        class="btn btn-xs2 btn-primary blue mr-1"><i class="fa fa-plus"></i> {{"Copy" | localize}}
                    </button>
                    <button (click)="createNews()" *ngIf="'Pages.Administration.FrontendPageView.Create' | permission"
                        class="btn btn-xs2 btn-primary blue mr-1"><i class="fa fa-plus"></i> {{"CreateNew" | localize}}
                    </button>
                    <button (click)="changeState(true)"
                        *ngIf="'Pages.Administration.FrontendPageView.Edit' | permission"
                        class="btn btn-xs2 btn-primary blue mr-1"><i class="fa fa-book"></i> {{"Release" | localize}}
                    </button>
                    <button (click)="changeState(false)"
                        *ngIf="'Pages.Administration.FrontendPageView.Edit' | permission"
                        class="btn btn-xs2 btn-warning mr-1"><i class="fa fa-reply"></i> {{"CancelRelease" | localize}}
                    </button>
                    <button (click)="delete()" *ngIf="'Pages.Administration.FrontendPageView.Delete' | permission"
                        class="btn btn-xs2 btn-warning"><i class="fa fa-trash"></i> {{"Delete" | localize}}
                    </button>

                    <a class="btn btn-smallEx" (click)='modalExpandOb.modalExHandle("small")'>
                        <i class="bi bi-arrows-angle-expand" *ngIf="!modalExpandOb.isSmallEx"></i>
                        <i class="bi bi-arrows-angle-contract" *ngIf="modalExpandOb.isSmallEx"></i>
                    </a>
                    <a class="btn btn-fullscreen" (click)='modalExpandOb.modalExHandle("full")'>
                        <i class="bi bi-arrows-fullscreen" *ngIf="!modalExpandOb.isFullScreen"></i>
                        <i class="bi bi-fullscreen-exit" *ngIf="modalExpandOb.isFullScreen"></i>
                    </a>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')">
                        <i aria-hidden="true" class="bi bi-x"></i>
                    </button>
                </span>
            </div>
            <div class="modal-body" [busyIf]="loading">
                <form class="form" autocomplete="new-password">
                    <div>
                        <div class="row align-items-center mb-4">
                            <div class="col-xl-12">
                                <div class="form-group m-form__group align-items-center">
                                    <div class="input-group">
                                        <input [(ngModel)]="filterText" name="filterText" autoFocus
                                            class="form-control m-input" [placeholder]="l('SearchWithThreeDot')"
                                            type="text">
                                        <div class="input-group-append">
                                            <button (click)="getListData()" class="btn btn-default" type="submit">
                                                <i class="icon-magnifier" [attr.aria-label]="l('Search')"></i>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>

                <div class="row align-items-center">
                    <!--<Primeng-TurboTable-Start>-->
                    <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                        <p-table #dataTable sortMode="multiple"
                            [value]="primengTableHelper.records"
                            rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false" [lazy]="true"
                            [responsive]="primengTableHelper.isResponsive"
                            [resizableColumns]="primengTableHelper.resizableColumns"
                            [(selection)]="selectedDatas"
                            dataKey="id" 
                            selectionMode="multiple">
                            <ng-template pTemplate="header">
                                <tr>
                                    <th style="width:38px">
                                        <p-tableHeaderCheckbox></p-tableHeaderCheckbox>
                                    </th>
                                    <th style="width: 200px">
                                        {{"Name" | localize}}
                                    </th>
                                    <th>
                                        {{"bodyView" | localize}}
                                    </th>
                                    <th style="width: 120px">
                                        {{'ReleaseState' | localize}}
                                    </th>
                                    <th style="width: 200px">
                                        {{"creationTime" | localize}}
                                    </th>
                                </tr>
                            </ng-template>
                            <ng-template pTemplate="body" let-record="$implicit">
                                <tr>
                                    <td style="width: 38px">
                                        <p-tableCheckbox [value]="record" (click)="$event.stopPropagation()">
                                        </p-tableCheckbox>
                                    </td>
                                    <td style="width: 200px">
                                        <span class="p-column-title">{{"Name" | localize}}</span>
                                        <a title="{{record.name}}" href="javascript:void(0)"
                                            (click)="edit(record)">{{record.name}}</a>
                                    </td>
                                    <td >
                                        <span class="p-column-title"> {{"bodyView" | localize}}</span>
                                        {{record.bodyView}}
                                    </td>
                                    <td style="width: 120px">
                                        <span class="p-column-title"> {{'ReleaseState' | localize}}</span>
                                        <span class="label label-success label-inline" *ngIf="record.isActive">{{'Yes' | localize}}</span>
                                        <span class="label label-dark label-inline" *ngIf="!record.isActive">{{'No' | localize}}</span>
                                    </td>
                                    <td style="width: 200px">
                                        <span class="p-column-title"> {{"CreationTime" | localize}}</span>
                                        {{record.creationTime| luxonFormat:'yyyy-MM-dd'}}
                                    </td>
                                </tr>
                            </ng-template>
                        </p-table>
                        <div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
                            {{'NoData' | localize}}
                        </div>
                        <div class="primeng-paging-container">
                            <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                                (onPageChange)="getListData($event)"
                                [totalRecords]="primengTableHelper.totalRecordsCount"
                                [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage"
                                [showCurrentPageReport]="true"
                                [currentPageReportTemplate]="'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount">
                            </p-paginator>
                        </div>
                    </div>
                    <!--<Primeng-TurboTable-End>-->
                </div>

            </div>
        </div>
    </div>
</div>
<create-or-edit-pageview-modal #createOrEditPageViewModal (callback)="reloadPage()">
</create-or-edit-pageview-modal>
<copy-pageview-modal #copyPageViewModal (callback)="copyViewsCallback($event)"></copy-pageview-modal>